/* libcellex.h */
#ifndef LIBCELLEX_H
#define LIBCELLEX_H

//	#define DEBUG_INFO 0x00
#define CXX_EXPORT __declspec(dllexport)

#ifdef __cplusplus	//造成lib调用时的问题，注释后修正，原因不明！2024-02-27 11:49:20
extern "C" {
#endif

	// vertice info
	typedef struct vertice_info
	{
		int id;
		double* point;	//[3] 坐标，构造时申请好内存

		vertice_info();
		~vertice_info();
	}_VERTICE_INFO;

	// faces info
	typedef struct face_info
	{
		int id;	// face id
		int vertice_size;	//number of vertices
		int* vertice_index;	// 顶点索引

		face_info();
		~face_info();
	}_FACE_INFO;

	/*off file info*/
	typedef struct off_info
	{
		int vertices;	// number of vertices
		int faces;	// number of faces
		int edges;	// number of edges

		//double* vertices_list;
		vertice_info* v_info;	// list of vertices，二维数组用一维数据表示
		face_info* f_info;	// faces infomation, 一维数组存储

		off_info();
		~off_info();
	}_OFF_INFO, * pOff_info;


	int CXX_EXPORT libcellex_init(off_info** _in);

	int CXX_EXPORT read_off(char* file);

	int CXX_EXPORT libcellex_free(off_info* _in);


	// 以下方法仅测试for test
	int CXX_EXPORT m_pr(int a, int b);

	// 一级指针，修改pa[0]=134，用户知道数组大小，申请栈
	int CXX_EXPORT func2_pointer(int* pa, int b);

	// 二维数组当成一维数组传入，修改[1][0]=1407，用户知道数组大小
	int CXX_EXPORT func3_pointer(int* pa, int col, int row);

	/*test return off file info, ok return 0*/
	int CXX_EXPORT func5_struct(off_info** _in_out);	//按照loadlibrary的思路


#ifdef __cplusplus
}	// end extern "C"
#endif

#endif
